﻿using UnityEngine;
using System.Collections;

public class MessageFollow : MonoBehaviour
{
    public Rigidbody2D Target;

    TextMesh textMesh;
    Vector3 offest;
    private void Awake()
    {
        textMesh = GetComponent<TextMesh>();
        textMesh.text = "质量：" + Target.mass + "\n" +
            "摩擦系数：" +
        Target.sharedMaterial.friction;
           offest = Target.transform.position - transform.position;
    }
    private void FixedUpdate()
    {
        transform.position = Target.transform.position - offest;
    }
}
